import 'package:sp_util/sp_util.dart';
import 'package:testlzhu/utils/common_data.dart';

class CommonNet {
  static const String apiHostLezhu = "http://dev.lezhu.shop/v6/";

  static var data = <String, dynamic>{};

  static getHearData() {
    String? token = SpUtil.getString("token", defValue: "");
    String? mobile = SpUtil.getString("phone", defValue: "");
    int? userid = SpUtil.getInt("userid", defValue: null);
    data.clear();
    data["timestamp"] = ((DateTime
        .now()
        .millisecondsSinceEpoch) ~/ 1000).toString();
    data["token"] = token;
    // data["userid"] = userid != null?"$userid":"";
    // data["userphone"] = mobile;
    data["appversion"] = "android.${CommonData.version}";

    return data;
  }
}
